package cn.ruituo.web;

import cn.ruituo.service.StudentService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "ShowStudentServlet",value = "/showStudentServlet")
public class ShowStudentServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
    private StudentService studentService=new StudentService();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        long stuno=Long.parseLong(request.getParameter("stuno"));
        request.setAttribute("stu",studentService.get(stuno));

        request.getRequestDispatcher("/WEB-INF/views/studentdetail.jsp").forward(request,response);

    }
}
